package random;

import java.util.Random;

public class SameSeed {

  public static void test() {
    Random random = new Random(100);
    System.out.println(random.nextInt(10) + "," + random.nextInt(30) + "," + random.nextInt(50));

    random = new Random(100);
    System.out.println(random.nextInt(10) + "," + random.nextInt(30) + "," + random.nextInt(50));

    random = new Random(100);
    System.out.println(random.nextInt(10) + "," + random.nextInt(30) + "," + random.nextInt(50));
  }


  public static void mathRadom() {
    // 与Math类使用的全局Random生成器一样，ThreadLocalRandom使用内部生成的种子进行初始化，否则可能无法修改。
    Math.random();
  }

}
